<?php

namespace App\Helpers;

use App\Services\File;

class FileHelper
{
    private static $fileService;

    public static function getInstance()
    {
        if (!self::$fileService) {
            self::$fileService = new File();
        }
        return self::$fileService;
    }

    public static function exists(string $path): bool
    {
        return self::getInstance()->exists($path);
    }

    public static function get(string $path): string
    {
        return self::getInstance()->get($path);
    }

    public static function put(string $path, string $contents): int|false
    {
        return self::getInstance()->put($path, $contents);
    }

    public static function delete(string $path): bool
    {
        return self::getInstance()->delete($path);
    }

    public static function size(string $path): int|false
    {
        return self::getInstance()->size($path);
    }

    public static function lastModified(string $path): int|false
    {
        return self::getInstance()->lastModified($path);
    }
}
